package com.feiyisuo.sso.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.session.FlushMode;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.HeaderHttpSessionIdResolver;

@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 3600,
        //redis前缀
        redisNamespace = "SSO_LOGIN",
        flushMode = FlushMode.IMMEDIATE// 立即生效
)
@Configuration
public class HttpSessionConfig {
//    @Bean
    public HeaderHttpSessionIdResolver headerHttpSessionIdResolver() {
        return new HeaderHttpSessionIdResolver("X-Auth-Token");
    }
}